package com.zl.tag;

import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.tagext.BodyTagSupport;

import com.system.comm.util.SpringContextUtil;
import com.system.common.pojo.SysParam;
import com.zl.service.ZlSysParamServiceImpl;

public class getDJ extends BodyTagSupport{
	
	private String paramKey;

	
	public String getParamKey() {
		return paramKey;
	}
	public void setParamKey(String paramKey) {
		this.paramKey = paramKey;
	}
	@Override
	public int doStartTag() throws JspException {
		JspWriter jspWriter=this.pageContext.getOut();
		
		ZlSysParamServiceImpl zlSysParamServiceImpl=(ZlSysParamServiceImpl) SpringContextUtil.getBean("zlSysParamServiceImpl");
		Map<String,Object> map=new HashMap<>();
		map.put("paramKey", paramKey);
		List<SysParam> sysParams=zlSysParamServiceImpl.selectByExample(map);
		try {
			jspWriter.write(sysParams.get(0).getParamValue());
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return super.SKIP_BODY;
	}
	@Override
	public int doEndTag() throws JspException {
		// TODO Auto-generated method stub
		return super.EVAL_BODY_INCLUDE;
	}
	
	
	
	

}
